home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / M2Crypto / RC4.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  1KB  |  34 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from m2 import rc4_new, rc4_free, rc4_set_key, rc4_update
  5.  
  6. class RC4:
  7.     rc4_free = rc4_free
  8.     
  9.     def __init__(self, key = None):
  10.         self.cipher = rc4_new()
  11.         if key:
  12.             rc4_set_key(self.cipher, key)
  13.         
  14.  
  15.     
  16.     def __del__(self):
  17.         if getattr(self, 'cipher', None):
  18.             self.rc4_free(self.cipher)
  19.         
  20.  
  21.     
  22.     def set_key(self, key):
  23.         rc4_set_key(self.cipher, key)
  24.  
  25.     
  26.     def update(self, data):
  27.         return rc4_update(self.cipher, data)
  28.  
  29.     
  30.     def final(self):
  31.         return ''
  32.  
  33.  
  34.